<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue</title>
    <script src="js/vue.js"></script>

</head>

<body>
    <div id="app">
        <p>{{ message }}</p>
        <p v-text="message"></p>
        <p v-html="message"></p>
        <p><input v-model="message"></p>
        <p><button @click="clickon">单击</button></p>
        <ul>
            <li v-for="item,index in list">
                {{index}}-{{item}}
            </li>
        </ul>

        <ul>
            <li v-for="item in list">
                <label>
                    <input type="checkbox" v-bind:value="item.id" v-model="checkVal" />
                    {{item.name}}
                </label>
            </li>
        </ul>
        <ul>
            <li v-for="item in checkVal">
                {{item}}
            </li>
        </ul>


    </div>


    <script>
        new Vue({
            el: '#app',
            data: {
                message: '<h1>Hello Vue...</h1>',
                checkVal: [],
                list: [
                    { "id": 1, "name": "花", age: 20 },
                    { "id": 2, "name": "李", age: 25 },
                    { "id": 3, "name": "先", age: 30 }
                ],
                param: {
                    page: 1,
                    size: 10,
                    ids: [1, 2, 3, 4],
                    name: "花花世界不必认真",
                    time: "2023-09-22"
                }
            },
            mounted() {
                console.log("页面加载后触发");
                this.getData();
            },
            methods: {
                getData() {
                    console.log(this.param);
                },

                clickon(event) {
                    console.log("单击事件" + this.checkVal);
                }
            }
        })
    </script>

</body>

</html>